import axios from '@/libs/api.request'

export const getTableData = () => {
  return axios.request({
    url: 'get_table_data',
    method: 'get'
  })
}

/** 日志 */
export const getLogList = (query, page, limit) => {
  return axios.request({
    url: 'sys/log/list',
    params: {
      query,
      page,
      limit
    },
    method: 'get'
  })
}

/** 参数 */
export const getParamList = (query, page, limit) => {
  return axios.request({
    url: 'sys/config/list',
    params: {
      query,
      page,
      limit
    },
    method: 'get'
  })
}

export const deleteParams = (userIds) => {
  return axios.request({
    url: '/sys/config/delete',
    data: userIds,
    method: 'post'
  })
}

export const saveOrUpdateParam = (user, type) => {
  const url = type ? '/sys/config/save' : '/sys/config/update'
  return axios.request({
    url: url,
    data: user,
    method: 'post'
  })
}
